package o;

import com.huawei.appgallery.foundation.account.bean.UserSession;
import com.huawei.appgallery.foundation.store.bean.installresult.ReportInstallResultResBean;
import com.huawei.appgallery.serverreqkit.api.bean.ResponseBean;
import com.huawei.appgallery.serverreqkit.api.listener.IServerCallBack;
import com.huawei.appmarket.service.installresult.dao.InstallResultCache;
import java.util.List;

public class eav extends Thread implements IServerCallBack {
    private static final Object ˊ = new Object();
    private static AsyLoader ॱ;

    private static AsyLoader ˊ() {
        AsyLoader o_cwa;
        synchronized (ˊ) {
            o_cwa = ॱ;
        }
        return o_cwa;
    }

    private static void ˎ(AsyLoader o_cwa) {
        synchronized (ˊ) {
            ॱ = o_cwa;
        }
    }

    public void run() {
        ˏ();
    }

    public void ˏ() {
        if (UserSession.getInstance().isLoginSuccessful()) {
            List ॱ = eaz.ˏ().ॱ();
            if (ॱ.isEmpty()) {
                Logger.ˏ("BRInstallResultTask", "InstallResultCache is empty.");
                return;
            }
            cvt ˏ = ˏ(ॱ);
            if (cfw.ॱ(ˊ())) {
                Logger.ˎ("BRInstallResultTask", "BatchReportInstallResultTask size:" + ॱ.size());
                ˎ(cfw.ˎ(ˏ, this));
                return;
            }
            Logger.ˎ("BRInstallResultTask", "Batch Report is running.");
            return;
        }
        Logger.ˎ("BRInstallResultTask", "unLogined!!!");
    }

    private cvt ˏ(List<InstallResultCache> list) {
        cvt o_eas = new eas();
        o_eas.ˎ(list);
        return o_eas;
    }

    public void prePostResult(BaseRequest o_cvu, ResponseBean responseBean) {
        Logger.ˎ("BRInstallResultTask", "Batch report result:" + responseBean.getRtnCode_());
        if (responseBean.getResponseCode() == 0 && (responseBean instanceof ReportInstallResultResBean) && ((ReportInstallResultResBean) responseBean).getRtnCode_() == 0) {
            eaz.ˏ().ˊ();
        }
        ˎ(null);
    }

    public void notifyResult(BaseRequest o_cvu, ResponseBean responseBean) {
    }
}
